package com.net.xpay.common.manager.impl.partner;

import com.net.common.dao.BasicMapper;
import com.net.common.manager.AbstractManager;
import com.net.xpay.common.dao.partner.PartnerDailyStatMapper;
import com.net.xpay.common.domain.partner.PartnerDailyStat;
import com.net.xpay.common.manager.partner.PartnerDailyStatManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDate;


@Component
public class PartnerDailyStatManagerImpl extends AbstractManager<PartnerDailyStat> implements PartnerDailyStatManager{

    @Autowired
    private PartnerDailyStatMapper mapper;


    @Override
    protected BasicMapper<Long, PartnerDailyStat> getMapper() {
        return mapper;
    }

    @Override
    public PartnerDailyStat findByDayAndPartnerId(LocalDate day, Long partnerId) {
        PartnerDailyStat condition = new PartnerDailyStat();
        condition.setDay(day);
        condition.setPartnerId(partnerId);
        return getByCondition(condition);
    }
}
